feat(opencode): added portable static builds#9430
Closed
goniz wants to merge 1 commit intoanomalyco:devfrom
Closed
feat(opencode): added portable static builds#9430goniz wants to merge 1 commit intoanomalyco:devfrom
goniz wants to merge 1 commit intoanomalyco:devfrom
Conversation
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Contributor
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
580e2e4 to
88a05a9
Compare
7f81be2 to
aed224c
Compare
aed224c to
fa0cb04
Compare
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
fa0cb04 to
8e68819
Compare
- Portable builds are multi arch, supporting linux-x64 and linux-aarch64 - `build-portable.ts` is replacing the existing musl binaries with their static variants - Files in dist/ retain their name "opencode-linux-*-musl" - `install` script updated to parse the system's glibc version in order to select the static musl variant even on non-alpine distros - build using: `bun run build && bun run build:portable` - build requires `docker` to be installed
8e68819 to
dd156b4
Compare
This was referenced Feb 17, 2026
6 tasks
Contributor
|
Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR adds support for building a variant of opencode cli that runs on non glibc / old distros.
OpenCode uses Bun’s build feature that creates a single file executable, but Bun does not provide truly static binaries.
This solution tries to solve the problem by bundling the musl variant and its required shared libraries in a Rust based single static executable that unpacks and runs the cli on runtime.
I’m using patchel to set the elf interpreter after extraction to direct the cli to the right libs.
How did you verify your code works?
Existing opencode install on Ubuntu 16.04:

Using this method:
https://github.com/user-attachments/assets/0846d5ab-c4f7-42fa-ab57-145a0fbeab53
Notes
I've used Rust since it provides a static musl target and the repo already has Rust code (desktop, tauri)
TODOs
Support aarch64Fixes #4908